<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录</title>
</head>
<body>
	<span style="color: red;">${info }</span>
	<form action="${pageContext.request.contextPath }/user/login" method="post">
		用户名：<input type="text" placeholder="请输入用户名" name="username" required="required" value="${username }">
			<span style="color: red">${msg }</span><br>
		密	码：<input type="password" placeholder="请输入密码" name="password" required="required">
			<span style="color: red">${msg2 }</span><br>
		验证码：<input type="text" name="captchacode" placeholder="请输入验证码" required="required">
			<img id="i" alt="验证码" src="${pageContext.request.contextPath }/kaptcha">
			<a id="a" href="">看不清？换一张</a><span style="color: red">${msg3 }</span><br>
		记住我：<input type="checkbox" name="checkbox" value="1"><br>
		<input type="submit" value="登录">
	</form>
	<div>
		<a href="${pageContext.request.contextPath }/user/toInsert">点击注册新账户</a>
		<input type="button" id="newBtn" value="点击注册新账户"> 
		<button type="button" id="newInp">点击注册新账户</button>
	</div>
</body>
<script type="text/javascript" src="${pageContext.request.contextPath }/statics/js/jquery-3.5.1.js"></script>
<script type="text/javascript">
	/* $(function(){
		var info=${info};
		if(info!=null||info!=""){
			alert("打个勾+1");
		}
	});  */

	$("#a").click(function(){
		$("#i").prop("src","${pageContext.request.contextPath }/kaptcha?"+new Date());
		//加上这个可以让页面不加载，重要！！！
		return false;
	});

	$("#newBtn,#newInp").click(function(){
		window.location.href="${pageContext.request.contextPath }/user/toInsert";
	});
</script>
</html>